/*
 * InitiatorMapperSolicitudFiec.java
 *
 * Created on July 6, 2007, 7:38 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package hero.initiatorMapper;

import hero.interfaces.BnProjectLocal;
import hero.util.HeroException;
import java.util.ArrayList;
import java.util.Collection;

/**
 *
 * @author kabad
 */
public class InitiatorMapperSolicitudFiec implements hero.initiatorMapper.InitiatorMapperI {

    /** Creates a new instance of InitiatorMapperSolicitudFiec */
    public InitiatorMapperSolicitudFiec() {
    }

    public Collection searchMembers(Object b, BnProjectLocal n, String userName) throws HeroException {
        ArrayList users = new ArrayList();
        //String projectName=n.getName();
        //String projectName=n.getBnProject().getName();
        String intiatorMapperName = n.getBnInitiatorMapper().getName();
        int initiatorMapperType = n.getBnInitiatorMapper().getType();
        String projectName = n.getName();

        // logs trace
        System.out.println("******");
        System.out.println("[CustomGroupMembers] Intiator Mapper Name:" + intiatorMapperName + " type = " + initiatorMapperType + " - Project name = " + projectName);
        try {
            System.out.print("username "+ userName);

            // To be implemented !!!
            // ...
            // return as ex. collection containing the connected user
            //users.add(userName);
            //users.add("lrivas");
            
            if (projectName.equals("Solicitar Ayudantes")) {
                System.out.println("***solicitar ayudantes***");
                users.add("lbeltran");
                users.add("atapia");
                users.add("guido");
            }

            if (projectName.equals("Solicitar Ser Ayudante")) {
                users.add("kabad");
                users.add("mponton");
                users.add("ccorral");
                users.add("ozambran");
            }
            if (projectName.equals("Solicitar Cambio de Carrera o Especializacion")) {
                System.out.println("***solicitar cambio de carrera***");
                users.add("mponton");
                users.add("ccorral");
                users.add("ozambran");
            }
            return users;
        } catch (Exception e) {
            throw new HeroException("Error setting initiator mapper: Name = " + intiatorMapperName + " type = " + initiatorMapperType + " - " + e.getMessage());
        }
    }
}
